<%-- 
    Document   : ws_wishlist
    Created on : 11-mag-2010, 16.55.28
    Author     : Rachid Ouchary, Fabio Strocco, Max Passaghe, Marco Tansini.
--%>

<%@page contentType="text/html" pageEncoding="UTF-8" import="webservices.*" import = "java.util.List"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>Wish List</title>
        <style type="text/css">
            body {
                font: 100% Verdana, Arial, Helvetica, sans-serif;
                background: #666666;
                margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
                padding: 0;
                text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
                color: #000000;
            }
            .oneColElsCtr #container {
                width: 600px;
                background: #FFFFFF;
                margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */
                border: 1px solid #000000;
                text-align: left; /* this overrides the text-align: center on the body element. */
            }
            .oneColElsCtr #mainContent {
                padding: 0 20px; /* remember that padding is the space inside the div box and margin is the space outside the div box */
            }

            #wish {
                background-color: #fff;
                -moz-border-radius: 8px;
                -webkit-border-radius: 8px;
                border: 3px solid #d5e5e5;
                padding: 10px;
                margin-bottom: 15px;

                background:
                    -webkit-gradient(
                    linear,
                    left bottom,
                    left top,
                    color-stop(0.06, rgb(64,247,232)),
                    color-stop(0.53, rgb(92,190,255)),
                    color-stop(0.77, rgb(117,152,255))
                    );
            }
            </style>
        </head>

        <body class="oneColElsCtr">
            <div id="container">
                <div id="mainContent">
                    <%
                                List<Wish> wishList = (List<Wish>) request.getAttribute("wishList");
                                if (wishList == null) {
                    %>
                    <p>
                        Username o password errati.
                    </p>
                    <p>
                        <a href="MainDispatcher">Torna alla pagina di login</a>
                    </p>
                    <%} else {%>
                    <%
                                                            for (Wish wish : wishList) {
                                                                Item item = wish.getItem();
                                                                Category category = item.getCategoria();
                    %>
                    <div id="wish">
                        <h1> Desiderio </h1>
                        <p>
                            Descrizione: <%= item.getDescrizione()%><br />
                            Categoria: <%= category.getCatName()%><br />
                            Voto: <%= wish.getVoto()%><br />
                            Priorità: <%= wish.getPriority()%> <br />
                            Prenotato: <%= (wish.isPrenotato() ? "si" : "no")%> <br/>
                        </p>
                        <form name="remove_wish" action="MainDispatcher?operation=remove_wish" method="POST">
                            <input type="hidden" name="wish_id" value="<%= wish.getId()%>"/>
                            <input type="submit" value="Rimuovi desiderio"/>
                        </form>
                    </div>
                    <%}%>
                    <%if (wishList.size() == 0) {%>
                    La wishList &egrave vuota.
                    <%}%>
                    <%}%>
                    <!-- end #mainContent --></div>
                <!-- end #container -->
            </div>
        </body>
    </html>
